<?php
	class ArticleModel extends Model{
		public $_validate =	array(
				array('title','2,30','标题必须在2-30位之间',Model::MUST_VALIDATE,'length',Model:: MODEL_BOTH),
				array('tag','0,30','标签描述不得大于30位',Model::MUST_VALIDATE,'length',Model:: MODEL_BOTH),
				array('keyword','0,30','关键字描述不得大于30位',Model::MUST_VALIDATE,'length',Model:: MODEL_BOTH),
				array('source','0,20','文章来源不得大于20位',Model::MUST_VALIDATE,'length',Model:: MODEL_BOTH),
				array('author','0,10','作者描述不得大于10位',Model::MUST_VALIDATE,'length',Model:: MODEL_BOTH),
				array('info','0,200','内容摘要不得大于200位',Model::MUST_VALIDATE,'length',Model:: MODEL_BOTH),
				array('title','require','标题必须填写'),
				array('content','require','正文内容必须填写'),
				
		);
		public $_auto =	array(
				array('date','time',self::MODEL_INSERT,'function'),
				array('attr','getAttr',self::MODEL_BOTH,'callback'),
		);
		
		public function getAttr(){
			return isset($_POST['attr']) ? implode(',', $_POST['attr']) : '';
		}
	}

?>